<!DOCTYPE html>
<html>
<head>
    <template file="Home/meta" />
    <template file="Home/css" />









</head>
<body>

<header data-am-widget="header"
class="am-header am-bg-fff am-header-fix  common-border-bottom" >
<div class="am-header-left am-header-nav">
    <a onclick="javascript:history.back(-1);return false;" class="">
        <i class="am-icon-angle-left am-text-xxl"></i>
    </a>
</div>

<h1 class="am-header-title">
    我的浏览记录
</h1>
<div class="am-header-right am-header-nav">

    <a class="  am-margin-bottom-sm ajax-get" href="{:U('delete')}" >清空</a>


</div>



</header>
<div class="am-g am-padding-vertical-sm common-border-bottom  common-border-top am-margin-top-sm  index_cate_product">




    <div class="am-block">


        <ul class="am-avg-sm-2"  id="product_list"></ul>




    </div>


</div>





<button class="am-btn am-btn-hui am-btn-block am-margin-bottom-sm" onclick="add_news(this)">加载更多</button>
<div data-am-widget="navbar" class="am-navbar am-cf am-navbar-index  common-border-top"
     id="">
    <template file="Home/bottom_nav" />
</div>
<template file="Home/js" />





<script>


    num = 1;

    function add_news(obj) {

        $.post("{:get_now_url()}", { page: num }, function (data) {
            var html = $("#product_list").html();

            if (data!=null) {


                $.each(data, function (news, v) {

                     html += "<div class=' am-cf cart-list-item common-border-bottom  am-bg-f5f5f5 am-margin-top-xs  am-padding-vertical-sm'>";
                     html += "    <div class='am-u-sm-3'><img src='"+ v.thumb+"' class='am-img-responsive' alt=''></div>";
                     html += "    <div class='am-u-sm-9 am-text-xs'>";
                     html += "        <a href=' /Home/Product/show/id/"+ v.id+"'' class=''><h3 class='am-margin-0'>"+ v.title+"</h3></a>";
                     html += "        <div class='pay am-margin-top-sm am-cf div_info ' >";
                     html += "            <div class='am-fl'>";
                     html += "                <span class='am-text-warning am-text-sm'> ￥"+ v.price+"</span>";
                     html += "            </div>";

                     html += "        </div>";
                     html += "";
                     html += "";
                     html += "    </div>";
                     html += "";
                     html += "";
                     html += "</div>";
                     html += "";




                });

                $("#product_list").html(html);

                num++;
            }
            else {

                $(obj).attr("disabled", "disabled");
                $(obj).html("没有了");
            }

        });


    }
    $(function () {
        add_news();

    })





</script>



</body>
</html>